package com.guiguli.array;

import java.util.Random;

public class array03_max_min_sum_avg {
    public static void main(String[] args) {
        Random r=new Random();
        int[] array=new int[10];
        for(int i=0;i< array.length;i++){
            array[i]=r.nextInt(100);
        }
        int max=0,min=array[0],avg=0,t=0;
        for(var i:array){
            t+=i;
            if(i>max){
                max=i;
            }
            if(i<min){
                min=i;
            }
        }
        avg=t/array.length;
        for(var i:array){
            System.out.println(i);
        }
        System.out.println("max="+max+"min="+min+"avg="+avg);
    }
}